package com.alibaba.citrus.ots.b2b.trade.order.functions.utils;

import org.apache.commons.lang3.StringUtils;

/**
 * @description: 金额转换
 * @author: qianlei
 * @create: 2021/10/29 15:55
 */
public class MoneyUtil {
    /**
     * 基于两位小数,四舍五入
     * @param amount
     * @return
     */
    public static Long formatRoundLong(String amount){
        if (StringUtils.isBlank(amount)){
            return 0L;
        }
        Double res = Double.parseDouble(amount) * 100;
        return Math.round(res);
    }

}
